package com.wiscamp.ninechapters.tags.enums;

/**
 * 知识点关系没
 */
public enum PointRelationTypes {
    AGGREGATION(671, "Aggregation"),  // 聚合 父子知识点层次
    DEPENDENCY(672, "Dependency"), // 依赖关系  前置知识点关系
    ASSOCIATION(673, "Association"); // 相关关系  相关知识点关系

    private final int value;

    private final String name;

    PointRelationTypes(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public int getValue() {
        return value;
    }

    public static PointRelationTypes valueOf(int value) {
        System.out.println("relation value: " + value);
        return switch (value) {
            case 671 -> PointRelationTypes.AGGREGATION;
            case 672 -> PointRelationTypes.DEPENDENCY;
            case 673 -> PointRelationTypes.ASSOCIATION;
            default -> PointRelationTypes.AGGREGATION;
        };
    }
}
